module executor.friend.client.SetContactsAliasName;

import msgtrans;
import message.Constants;
import message.MsgDefine;
import google.protobuf;
import hunt.logging;
import client.ImClient;
import std.array;
import std.conv : to;

@TransportClient(logicClientName)
class SetContactsAliasName : AbstractExecutor!(SetContactsAliasName){

   @MessageId(MESSAGE.CMD_SET_CONTACTS_ALIAS_NAME_RES)
   void setContactsAliasName(TransportContext ctx, MessageBuffer buffer)
   {
      auto res = new SetContactAliasNameRES;
      buffer.data.fromProtobuf!SetContactAliasNameRES(res);
      TransportSession[] clients =  ImClient.getInstance().getImClient(to!ulong( res.userId));
      foreach (TransportSession client ; clients)
      {
        client.send( new MessageBuffer( MESSAGE.CMD_SET_CONTACTS_ALIAS_NAME_RES,res.toProtobuf.array));
      }
   }
}

